import { Form } from "@/components/layout/form/form";
import { CASCADERS, SELECT, TEXT, TEXTAREA } from "@/utils/enums/type-enums";

export const personnelSearchForms: Form[] = [
  {
    label: null, card: [
      {
        type: TEXT,
        label: '人员名称',
        name: 'displayName',
        placeholder: '输入人员名称'
      },
      {
        type: TEXT,
        label: '身份证号',
        name: 'idCard',
        placeholder: '输入身份证号'
      },
      {
        type: TEXT,
        label: '手机号',
        name: 'cellphone',
        placeholder: '输入手机号'
      }
    ]
  }
];

export const addPersonnelForms: Form[] = [
  {
    label: null, card: [
      {
        type: TEXT,
        label: '人员名称',
        name: 'displayName',
        placeholder: '输入人员名称'
      },
      { line: true },
      {
        type: TEXT,
        label: '身份证号',
        name: 'idCard',
        placeholder: '输入身份证号'
      },
      { line: true },
      {
        type: TEXT,
        label: '手机号',
        name: 'cellphone',
        placeholder: '输入手机号'
      },
      { line: true },
      {
        type: CASCADERS,
        label: '空间',
        name: 'roomType',
        placeholder: '选择空间',
        options: [] as any
      },
      { line: true },
      {
        type: SELECT,
        label: '床位',
        name: 'bedId',
        placeholder: '选择床位',
        options: [] as any
      }
    ]
  }
]

export const rulesAddPersonnel = {
  displayName: [{ required: true, message: '人员名称不能为空！', trigger: 'blur' }],
  idCard: [{ required: true, message: '身份证号不能为空！', trigger: 'blur' },
  {
    pattern: /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/,
    message: '身份证号格式错误',
    trigger: ['blur', 'change'],
  },
  { min: 17, max: 18, message: '请输入18位身份证号码', trigger: 'change' }
  ],
  cellphone: [{ required: true, message: '手机号不能为空！', trigger: 'blur' }],
}
export const relationPersonnelForms = [
  {
    label: null, card: [
      {
        type: TEXT,
        label: '烟雾',
        name: 'nbiot_smoke',
        search: true,
        searchKey: 'nbiot_smoke',
        span: '12',
        placeholder: '选择烟雾'
      },
      {
        type: TEXT,
        label: '燃气',
        name: 'nbiot_gas',
        search: true,
        searchKey: 'nbiot_gas',
        span: '12',
        placeholder: '选择燃气'
      },
      { line: true },
      {
        type: TEXT,
        label: '水浸',
        name: 'nbiot_flood',
        search: true,
        searchKey: 'nbiot_flood',
        span: '12',
        placeholder: '选择水浸'
      },
      {
        type: TEXT,
        label: '红外',
        name: 'infrared',
        search: true,
        searchKey: 'infrared',
        span: '12',
        placeholder: '选择红外'
      },
      { line: true },
      {
        type: TEXT,
        label: '门磁',
        name: 'gate_magnetism',
        search: true,
        searchKey: 'gate_magnetism',
        span: '12',
        placeholder: '选择门磁'
      },
      {
        type: TEXT,
        label: '拉绳',
        name: 'nbiot_alarm',
        search: true,
        searchKey: 'nbiot_alarm',
        span: '12',
        placeholder: '选择拉绳'
      },
      { line: true },
      {
        type: TEXT,
        label: '手环',
        name: 'four_g_watch',
        search: true,
        searchKey: 'four_g_watch',
        span: '12',
        placeholder: '选择手环'
      }
    ]
  }
]

